package com.it.io;

public class ObjectArrayIOSequence<T> extends AbstractIOSequence<T[], T> {

	
	@Override
	public void initInput(T[] input) {
		this.input = input;
	}

	@Override
	public boolean hasInput() {
		return inputIndex < input.length;
	}

	@Override
	public T input() {
		return input[inputIndex++];
	}

	@Override
	public void initOutput(int size) {
		output = (T[]) new Object[size];
	}

	@Override
	public void output(T e) {
		output[outputIndex++] = e;
	}

	@Override
	public T[] finish() {
		return output;
	}

	

}